package sc.prototype.pfs.eventnotify.model;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import sc.prototype.common.Utils;
import sc.prototype.pfs.eventnotify.model.enums.ContentCollectorType;
import sc.prototype.pfs.eventnotify.model.enums.EnableFlag;
import sc.prototype.pfs.eventnotify.model.enums.EventType;

public class NotifyConfig implements Cloneable {

    /** 配置匹配表达式matchExpression计算结果包含表示匹配 */
    public static final String MATCH_CONTAIN = "[MATCH]";

    /** 通知配置Id */
    long configId;

    /** 通知配置名称 */
    String configName;

    /** 事件类型 */
    EventType eventType;

    /** 配置匹配表达式 */
    String matchExpression;

    /** 通知内容采集器类型 */
    ContentCollectorType contentCollectorType;

    /** 通知目标列表 */
    List<NotifyTarget> notifyTargets;

    /** 扩展信息 */
    HashMap<String, String> extensions;

    /** 启用标识 */
    EnableFlag enableFlag;

    /** 生效时间 */
    Date gmtBeginValid;

    /** 失效时间 */
    Date gmtBeginInvalid;

    /** 备注 */
    String memo;

    /** 操作员 */
    String operator;

    /** 创建时间 */
    Date gmtCreate;

    /** 创建时间 */
    Date gmtModify;

    public long getConfigId() {
        return configId;
    }

    public void setConfigId(long configId) {
        this.configId = configId;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public EventType getEventType() {
        return eventType;
    }

    public void setEventType(EventType eventType) {
        this.eventType = eventType;
    }

    public String getMatchExpression() {
        return matchExpression;
    }

    public void setMatchExpression(String matchExpression) {
        this.matchExpression = matchExpression;
    }

    public ContentCollectorType getContentCollectorType() {
        return contentCollectorType;
    }

    public void setContentCollectorType(ContentCollectorType contentCollectorType) {
        this.contentCollectorType = contentCollectorType;
    }

    public List<NotifyTarget> getNotifyTargets() {
        return notifyTargets;
    }

    public void setNotifyTargets(List<NotifyTarget> notifyTargets) {
        this.notifyTargets = notifyTargets;
    }

    public HashMap<String, String> getExtensions() {
        return extensions;
    }

    public void setExtensions(HashMap<String, String> extensions) {
        this.extensions = extensions;
    }

    public EnableFlag getEnableFlag() {
        return enableFlag;
    }

    public void setEnableFlag(EnableFlag enableFlag) {
        this.enableFlag = enableFlag;
    }

    public Date getGmtBeginValid() {
        return gmtBeginValid;
    }

    public void setGmtBeginValid(Date gmtBeginValid) {
        this.gmtBeginValid = gmtBeginValid;
    }

    public Date getGmtBeginInvalid() {
        return gmtBeginInvalid;
    }

    public void setGmtBeginInvalid(Date gmtBeginInvalid) {
        this.gmtBeginInvalid = gmtBeginInvalid;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModify() {
        return gmtModify;
    }

    public void setGmtModify(Date gmtModify) {
        this.gmtModify = gmtModify;
    }

    @Override
    public String toString() {
        return Utils.toString(this);
    }

    @Override
    public NotifyConfig clone() {
        NotifyConfig config = null;
        try {
            config = (NotifyConfig) super.clone();
        } catch (CloneNotSupportedException e) {
        }
        return config;
    }

}
